package com.example.element.module.webView

import android.content.Context
import android.content.Intent
import android.webkit.WebViewClient
import com.example.common.base.AbsActivity
import com.example.element.R
import com.example.element.databinding.ActWebviewTestBinding
import kotlinx.android.synthetic.main.act_webview_test.*

class WebViewTestActivity : AbsActivity<ActWebviewTestBinding>() {

    companion object{

        @JvmStatic
        fun open(context: Context) {
            context.startActivity(Intent(context, WebViewTestActivity::class.java))
        }
    }

    override fun getLayoutId(): Int {
        return R.layout.act_webview_test
    }

    override fun main() {
        //通过webView.setting设置浏览器属性
        mBinding.webView.settings.javaScriptEnabled=true
        //网页跳转保持在当前webView中显示
        mBinding.webView.webViewClient= WebViewClient()
        webView.loadUrl("https://www.baidu.com")
    }

    override fun initListener() {

    }
}